package com.xzh.model;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.*;

import java.util.Date;

@TableName("users")
@Setter
@Getter
public class Users {
    @TableId(type = IdType.AUTO)
    private Integer userId;

    @TableField(condition = SqlCondition.LIKE, whereStrategy = FieldStrategy.NOT_EMPTY)
    @NotBlank(message = "请输入用户名")
    @Size(min = 3, max = 20, message = "长度在 3 到 20 个字符")
    private String username;

    @NotBlank(message = "请输入密码")
    private String password;

    @NotBlank(message = "请输入手机号")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "请输入正确的手机号")
    private String phone;

    private Integer status;
    private String avatar;
    private Date createTime;
    private Date updateTime;
}
